<template>
	<view>
		<button type="default" @click="vibrate">使手机发生振动</button>
		<button type="default" @click="vibrateLong">使手机发生较长时间的振动（400ms）</button>
		<button type="default" @click="vibrateShort">使手机发生较短时间的振动（15ms）</button>

		<view>iOS上只有长震动，没有短震动</view>
		<view>iOS上需要手机设置“打开响铃时震动”或“静音时震动”，否则无法震动</view>
		<view>vibrate只适用于钉钉小程序、支付宝小程序</view>
	</view>
</template>

<script>
	export default {
		methods: {
			vibrate() {
				uni.vibrate({
					success: function() {
						console.log('success');
					}
				});
			},
			vibrateLong() {
				uni.vibrateLong({
					success: function() {
						console.log('success');
					}
				});
			},
			vibrateShort() {
				uni.vibrateShort({
					success: function() {
						console.log('success');
					}
				});
			}
		}
	}
</script>

<style scoped>

</style>
